home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Development Platforms / LISP Related / Generalized LISP / Glisp 1.2 / Source files / Glisp.glisp < prev    next >
Encoding:
Text File  |  1990-08-14  |  1.8 KB  |  58 lines  |  [TEXT/CCL ]

  1.  
  2. ~---------------------------------------------------------------------------------------~
  3. ~       Rules for "Generalized Lisp" -- a generalized programming language        ~
  4. ~---------------------------------------------------------------------------------------~
  5. ~
  6. ~ Glisp will read a program in any programming language for which rules are supplied.
  7. ~ The languages may be freely intermixed.
  8.  
  9.  
  10. -define language Glisp-
  11.  
  12.  
  13. -Lisp-
  14.  
  15. `(export '(glispProgram glispLanguage) :glisp)
  16.  
  17.  
  18. -Plisp-
  19.  
  20. glispProgram =
  21.     ~ A Glisp program is a sequence of expressions in any Glisp language.
  22.  
  23.     [ <glispLanguage>:p ]*  <eof>  ->  ( [::p]* );
  24.  
  25.  
  26. glispLanguage =
  27.     ~ A Glisp language is Plisp, Lisp, or a dialect added by someone.
  28.  
  29.     '-  Plisp  '-  <plispProgram>:p  -> :p,
  30.  
  31.     '-  Lisp   '-  <lispProgram>:p   -> :p,
  32.  
  33.     '-  define  language  <identifier>:lang  '-  ->  <targetLanguage :lang>  nil;
  34.  
  35.  
  36. ~---------------------------------------------------------------------------------------~
  37. ~           Rules for the Lisp dialect (standard Common Lisp)            ~
  38. ~---------------------------------------------------------------------------------------~
  39.  
  40. lispProgram =
  41.     ~ A Lisp program is a sequence of Lisp expressions, terminated by a symbol.
  42.     ~ Note: each expression is read using the Glisp read table.  In practice, this
  43.     ~ means that ALL LISP EXPRESSIONS SHOULD BE PRECEDED BY A BACK QUOTE (`);
  44.     ~ e.g.        `(defun foo (x) x)
  45.  
  46.     <sourceLanguage Lisp>  [<lispExpression>:e]*  ->  :e;
  47.  
  48.  
  49. lispExpression =
  50.     ~ A "Lisp expression" is any Common Lisp data type except a symbol.
  51.     ~ Function-like things are checked to see if they're being redefined.
  52.  
  53.     ([defun | defmacro | `define-modify-macro | deftype | defpfun] :name ...)  ->
  54.            <checkFunction :name>
  55.            ([defun | defmacro | `define-modify-macro | deftype | defpfun] :name ...),
  56.  
  57.     :anything  {if `(not (symbolp #$anything)) }  ->  :anything;
  58.